const btn = document.getElementById('Button');
const msg_box = document.getElementById('Content');
btn.addEventListener('click', function() {
    // chrome.tabs.getAllInWindow(function(tab) {
    //     console.log(tab);
    // });
    chrome.tabs.query({currentWindow: true}, function(tabs) {
        // chrome.tabs.sendMessage(tabs[1].id, {cmd: 'getShapshotAsHtml'}, function(response) {});
        for (var i=0,len=tabs.length; i<len; i++)
        {
            chrome.tabs.sendMessage(tabs[i].id, {cmd: 'getShapshotAsHtml'}, function(response) {
                console.log('send');
            });
        }
    });
    // chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
    //     chrome.tabs.sendMessage(tabs[0].id, {cmd: 'getShapshotAsHtml'}, function(response) {
    //         // do nothing
    //         console.log('send')
    //     });
    // });
});
